	.text
	.align	2
main:
	addi	a1, zero, 1024
	addi	a2, zero, 1
.L31:	
	sub	a1, a1, a2
	bne	a1, zero, .L31
	addi	a2, zero, 0
	addi	a1, zero, 0
	addi	sp,sp,-112
	sw	ra,108(sp)
	sw	s0,104(sp)
	addi	s0,sp,112
	li	a5,784
	sw	a5,-32(s0)
	li	a5,100
	sw	a5,-28(s0)
	li	a5,1
	sw	a5,-44(s0)
	li	a5,100
	sw	a5,-40(s0)
	li	a5,100
	sw	a5,-56(s0)
	li	a5,26
	sw	a5,-52(s0)
	li	a5,1
	sw	a5,-68(s0)
	li	a5,26
	sw	a5,-64(s0)
	li	a5,1
	sw	a5,-80(s0)
	li	a5,784
	sw	a5,-76(s0)
	li	a5,1
	sw	a5,-92(s0)
	li	a5,100
	sw	a5,-88(s0)
	li	a5,1
	sw	a5,-104(s0)
	li	a5,26
	sw	a5,-100(s0)
	li	a5,4096
	sw	a5,-20(s0)
	lw	a5,-20(s0)
	sw	a5,-36(s0)
	lw	a4,-20(s0)
	li	a5,315392
	addi	a5,a5,-1792
	add	a5,a4,a5
	sw	a5,-48(s0)
	lw	a4,-20(s0)
	li	a5,315392
	addi	a5,a5,-1392
	add	a5,a4,a5
	sw	a5,-60(s0)
	lw	a4,-20(s0)
	li	a5,323584
	addi	a5,a5,816
	add	a5,a4,a5
	sw	a5,-72(s0)
	lw	a4,-20(s0)
	li	a5,323584
	addi	a5,a5,920
	add	a5,a4,a5
	sw	a5,-84(s0)
	lw	a4,-20(s0)
	li	a5,327680
	addi	a5,a5,-40
	add	a5,a4,a5
	sw	a5,-96(s0)
	lw	a4,-20(s0)
	li	a5,327680
	addi	a5,a5,360
	add	a5,a4,a5
	sw	a5,-108(s0)
	addi	a6,s0,-108
	addi	a5,s0,-96
	addi	a4,s0,-72
	addi	a3,s0,-60
	addi	a2,s0,-48
	addi	a1,s0,-36
	addi	a0,s0,-84
	call	run_predict
	addi  a7,zero,34
    ecall
    addi  a7,zero,10
    ecall
	mv	a5,a0
	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
	lw	a5,-36(s0)
	lw	a5,4(a5)
	lw	a4,-20(s0)
	blt	a4,a5,.L7
	nop
	lw	s0,44(sp)
	addi	sp,sp,48
	jr	ra
	.align	2
relu:
	addi	sp,sp,-48
	sw	s0,44(sp)
	addi	s0,sp,48
	sw	a0,-36(s0)
	sw	zero,-20(s0)
	j	.L9
.L15:
	sw	zero,-24(s0)
	j	.L10
.L14:
	lw	a5,-36(s0)
	lw	a4,0(a5)
	lw	a5,-36(s0)
	lw	a3,8(a5)
	lw	a5,-20(s0)
	mul	a3,a3,a5
	lw	a5,-24(s0)
	add	a5,a3,a5
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa5,0(a5)
	fmv.s.x	fa4,zero
	fgt.s	a5,fa5,fa4
	beqz	a5,.L17
	lw	a5,-36(s0)
	lw	a4,0(a5)
	lw	a5,-36(s0)
	lw	a3,8(a5)
	lw	a5,-20(s0)
	mul	a3,a3,a5
	lw	a5,-24(s0)
	add	a5,a3,a5
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa5,0(a5)
	j	.L13
.L17:
	fmv.s.x	fa5,zero
.L13:
	lw	a5,-36(s0)
	lw	a4,0(a5)
	lw	a5,-36(s0)
	lw	a3,8(a5)
	lw	a5,-20(s0)
	mul	a3,a3,a5
	lw	a5,-24(s0)
	add	a5,a3,a5
	slli	a5,a5,2
	add	a5,a4,a5
	fsw	fa5,0(a5)
	lw	a5,-24(s0)
	addi	a5,a5,1
	sw	a5,-24(s0)
.L10:
	lw	a5,-36(s0)
	lw	a5,8(a5)
	lw	a4,-24(s0)
	blt	a4,a5,.L14
	lw	a5,-20(s0)
	addi	a5,a5,1
	sw	a5,-20(s0)
.L9:
	lw	a5,-36(s0)
	lw	a5,4(a5)
	lw	a4,-20(s0)
	blt	a4,a5,.L15
	nop
	lw	s0,44(sp)
	addi	sp,sp,48
	jr	ra
	.align	2
run_predict:
	addi	sp,sp,-80
	sw	ra,76(sp)
	sw	s0,72(sp)
	addi	s0,sp,80
	sw	a0,-52(s0)
	sw	a1,-56(s0)
	sw	a2,-60(s0)
	sw	a3,-64(s0)
	sw	a4,-68(s0)
	sw	a5,-72(s0)
	sw	a6,-76(s0)
	lw	a2,-72(s0)
	lw	a1,-56(s0)
	lw	a0,-52(s0)
	call	matmul
	sw	zero,-20(s0)
	j	.L19
.L20:
	lw	a5,-72(s0)
	lw	a4,0(a5)
	lw	a5,-20(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa4,0(a5)
	lw	a5,-60(s0)
	lw	a4,0(a5)
	lw	a5,-20(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa5,0(a5)
	lw	a5,-72(s0)
	lw	a4,0(a5)
	lw	a5,-20(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	fadd.s	fa5,fa4,fa5
	fsw	fa5,0(a5)
	lw	a5,-20(s0)
	addi	a5,a5,1
	sw	a5,-20(s0)
.L19:
	lw	a4,-20(s0)
	li	a5,99
	ble	a4,a5,.L20
	lw	a0,-72(s0)
	call	relu
	lw	a2,-76(s0)
	lw	a1,-64(s0)
	lw	a0,-72(s0)
	call	matmul
	sw	zero,-24(s0)
	j	.L21
.L22:
	lw	a5,-76(s0)
	lw	a4,0(a5)
	lw	a5,-24(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa4,0(a5)
	lw	a5,-68(s0)
	lw	a4,0(a5)
	lw	a5,-24(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa5,0(a5)
	lw	a5,-76(s0)
	lw	a4,0(a5)
	lw	a5,-24(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	fadd.s	fa5,fa4,fa5
	fsw	fa5,0(a5)
	lw	a5,-24(s0)
	addi	a5,a5,1
	sw	a5,-24(s0)
.L21:
	lw	a4,-24(s0)
	li	a5,25
	ble	a4,a5,.L22
	sw	zero,-32(s0)
	lui	a5,2
	flw	fa5,0(a5)
	fsw	fa5,-36(s0)
	sw	zero,-28(s0)
	j	.L23
.L26:
	lw	a5,-76(s0)
	lw	a4,0(a5)
	lw	a5,-28(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa5,0(a5)
	flw	fa4,-36(s0)
	flt.s	a5,fa4,fa5
	beqz	a5,.L24
	lw	a5,-76(s0)
	lw	a4,0(a5)
	lw	a5,-28(s0)
	slli	a5,a5,2
	add	a5,a4,a5
	flw	fa5,0(a5)
	fsw	fa5,-36(s0)
	lw	a5,-28(s0)
	sw	a5,-32(s0)
.L24:
	lw	a5,-28(s0)
	addi	a5,a5,1
	sw	a5,-28(s0)
.L23:
	lw	a4,-28(s0)
	li	a5,25
	ble	a4,a5,.L26
	lw	a5,-32(s0)
	andi	a5,a5,0xff
	addi	a5,a5,65
	andi	a5,a5,0xff
	mv	a0,a5
	lw	ra,76(sp)
	lw	s0,72(sp)
	addi	sp,sp,80
	jr	ra
